import React from "react";
import {ActivityIndicator, Dimensions, StyleSheet, View} from "react-native";
import PropTypes from 'prop-types';

const WIN_WIDTH = Dimensions.get("window").width;

//加载页
class LoadingView extends React.PureComponent {


  constructor() {
    super();
    this.state = {};
  }


  render() {
    return (<View style={{
      justifyContent: "center",
      alignItems: "center",
      flexDirection: "row",
      flex: 1,
      backgroundColor:this.props.backgroundColor,
      width:'100%',
      ...this.props.style
    }}>
      <ActivityIndicator color={this.props.color} animating={this.props.animating || true} size={"large"}/>
    </View>)
      ;
  }
}

LoadingView.propTypes = {
  color: PropTypes.string,
  backgroundColor: PropTypes.string,
};

LoadingView.defaultProps = {
  color:'#999',
  backgroundColor: 'white'
};
export default LoadingView;
